PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Appearance Manager >

Programming With the Appearance Manager


GetThemeMenuBarHeight

Obtains the height of a menu bar.

pascal OSStatus GetThemeMenuBarHeight (SInt16 *outHeight);
outHeight
A pointer to a signed 16-bit integer. On return, the integer value represents the height (in pixels) of the menu bar.
function result
A result code; see Result Codes .
DISCUSSION

The GetThemeMenuBarHeight function obtains the specified height of a menu bar in the current theme. This is in contrast to the Menu Manager function GetMBarHeight , which obtains the actual space that the menu bar is currently occupying on the screen. In most instances, the values produced by these two functions are the same. But, when the menu bar is hidden, GetMBarHeight produces a value of 0, and GetThemeMenuBarHeight still provides the "ideal" menu bar height.

SPECIAL CONSIDERATIONS

Because menu bar heights may vary among appearances by one or more pixels, you should check the current menu bar height after a theme switch. Specifically, your application should respond to the theme-switch Apple event, kAEAppearanceChanged , by checking the current menu bar height. See Appearance Manager Apple Event Constants for more details on kAEAppearanceChanged .

It is important to check the menu bar height before positioning any windows. Failure to do so may result in the menu bar overlapping your application's windows.

VERSION NOTES

Available with Appearance Manager 1.0.1 and later.


© 1999 Apple Computer, Inc. – (Last Updated 29 April 99)